package com.kuzma.itibo.controllers;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;

//import org.springframework.beans.factory.annotation.Autowired;

import com.kuzma.itibo.dao.UserMapper;
import com.kuzma.itibo.datamodel.User;

@ManagedBean(name = "helloWorld", eager = true)
public class HelloWorld {
   
	/*public HelloWorld() {
		System.out.println("HelloWorld started!");
	}
	public String getMessage() {
		return "Hello World!";
	}*/
	
	@ManagedProperty(value = "#{userMapper}")
	private UserMapper userMapper;
	
	public String getFirstUser() {
		User user = userMapper.getUserById(1L);
		return user.toString();
	}
	
	//Getters & Setters
	public UserMapper getUserMapper() {
		return userMapper;
	}
	public void setUserMapper(UserMapper userMapper) {
		this.userMapper = userMapper;
	}
}
